/*
** warnning
    ---getParent        :parent   Dir
    ---getCurrent       :Exe      Dir

*/

#include "AppPath.h"
#include "../FileAndDir/FileOperator.h"
#include "../Log/AppLog.h"

AppPath::AppPath()
{

}



QString AppPath::getParent()
{
    return  QDir::currentPath() ;
}

QString AppPath::getCurrent()
{
    return  QCoreApplication::applicationFilePath();
}

QString AppPath::getPath()
{
    return  QCoreApplication::applicationDirPath();
}

QString AppPath::getAppResource()
{
    return  QCoreApplication::applicationDirPath()+"/resource";
}

QString AppPath::getAppConf()
{
    return  QCoreApplication::applicationDirPath()+"/conf";
}

QString AppPath::getAppScript()
{
    return  QCoreApplication::applicationDirPath()+"/script";
}

QString AppPath::getAppHome()
{
    return  QDir::homePath();
}

QString AppPath::getAppRoot()
{
    return  QDir::rootPath();
}

QString AppPath::getAppTemp()
{
    return  QDir::tempPath();
}



AppPath * AppPath::instance = nullptr;

AppPath *AppPath::GetInstance()
{
    if(nullptr == instance)
    {
        instance = new AppPath();
    }
    return instance;
}
